package cn.didi.feidi.androidorder;

import android.app.Activity;
import android.app.Application;
import android.content.Context;

import cn.didi.feidi.androidorder.core.FeidiMessageHandler;
import cn.didi.feidi.androidorder.model.NetworkTipBO;

/**
 * Created by king on 2017/8/2.
 */

public class OrderApplication extends Application{


    private static Context appContext;

    private static Activity mCurActivity;

    public static NetworkTipBO networkTip = new NetworkTipBO();

    private static FeidiMessageHandler mHandler;

    /**
     * 用户位置
     * longitude 经度
     */
    private static double longitude;
    /**
     * 用户位置
     * latitude 纬度
     */
    private static double latitude;

    public static FeidiMessageHandler getFeidiMessageHandler() {
        if (mHandler == null) {
            mHandler = FeidiMessageHandler.getInstance();
        }
        return mHandler;
    }

    @Override
    public void onCreate() {
        super.onCreate();
        appContext = getApplicationContext();
    }

    public static Context getContext() {
        return appContext;
    }

    public static Activity getCurActivity() {
        return mCurActivity;
    }

    public static void setCurActivity(Activity activity) {
        mCurActivity = activity;
    }

    public static double getLongitude() {
        return longitude;
    }

    public static void setLongitude(double lon) {
        longitude = lon;
    }

    public static double getLatitude() {
        return latitude;
    }

    public static void setLatitude(double lat) {
        latitude = lat;
    }
}
